const router = require('koa-router')()
const mockjs = require('mockjs')

router.get('/', async(ctx, next) => {
    await ctx.render('index', {
        title: 'Hello Koa 2!'
    })
});

router.post('/kaipanBackend/housesHot', async(ctx, next) => {
    ctx.body = {
        "status": 200,
        "message": "success",
        "data": {
            "current_index": 0,
            "total_size": 21,
            "total_page": 11,
            "page_size": 2,
            "list": [
                {
                    "id": 111961,   //id
                    "open_room_guid": "0001AA10000000H5Q9HO", //开盘房源id
                    "open_guid": "0001AA10000000H5Q99X",    //开盘方案id
                    "bld_name": "测试N栋",   //楼栋
                    "room_guid": "00015610000000FVSTPA",        //房源id
                    "state": null,  //房源状态
                    "unit": "4单元",  //单元
                    "unit_no": 4,   //单元序号
                    "kp_activity_id": 63,   //开盘方案id
                    "floor": "8",       //楼层
                    "floor_no": 8,  //楼层序号
                    "room_no": "804",   //房号
                    "room_info": null,  //房源名称
                    "bld_area": 2500,   //建筑面积
                    "tn_area": 2000,    //套内面积
                    "room_type": 1, //房间类型（0未知，1住宅，2公寓，301独栋别墅，302双拼别墅，303联排别墅，4商铺，5写字楼，6车位，7公建配套）
                    "price": null,  // 建筑单价
                    "tn_price": null,   //套内单价
                    "total": 12500000,  //总价
                    "create_time": null,    //创建时间
                    "hx_type": "test2",     //户型名称
                    "favorite_num": 1       //收藏数量
                }
            ]
        }
    }
});


module.exports = router